#!/bin/sh

# PROVIDE: %%OUTNAME%%
# REQUIRE: DAEMON LOGIN inetd

# Add the following line to your /etc/rc.conf[.local] to enable %%OUTNAME%%:
#
#     %%OUTNAME%%_enable="YES"
#
# You can specify parameters in %%OUTNAME%%_flags, see output of %%OUTNAME%% -h
# for more details.

%%OUTNAME%%_enable=${%%OUTNAME%%_enable:="NO"}
%%OUTNAME%%_user="%%USER%%"

. /etc/rc.subr

name=%%OUTNAME%%
rcvar=`set_rcvar`

command=%%BINDIR%%/${name}
stop_cmd="%%OUTNAME%%_stop"

%%OUTNAME%%_stop() {
	pkill -u `id -u $%%OUTNAME%%_user` $name
}

load_rc_config ${name} 

run_rc_command "$1"
